package com.zy.spring3;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller//相当于<bean id="springMVC_Test1" class="com.zy.spring3.springMVC_Test1"></bean>产生一个对象
@RequestMapping("/spring1")
public class SpringMVC_Test1
{
    @RequestMapping("/hello")//匹配请求URL，get和post方法都可行
    public String helloworld()
    {
        //依据视图解析器，拼接字符串，访问http://localhost:8080/SpringTest3/spring1/hello
        return "Hello";
    }
}
